try:
    print(num)
except (NameError, ZeroDivisionError, FileNotFoundError) as result:
    print(result)  # 捕获异常描述信息
print("=================")

import traceback

try:
    print('---------------------')
    print(1 / 0)
except:
    traceback.print_exc() # 可以更详细地知道报错信息
